home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / mididemo / aboutbox.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-05-02  |  9.6 KB  |  274 lines

  1. VERSION 2.00
  2. Begin Form AboutBox 
  3.    BackColor       =   &H00FFFFFF&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "About"
  6.    ClientHeight    =   5640
  7.    ClientLeft      =   1185
  8.    ClientTop       =   2070
  9.    ClientWidth     =   4920
  10.    ClipControls    =   0   'False
  11.    ControlBox      =   0   'False
  12.    FillColor       =   &H00FFFFFF&
  13.    FontBold        =   -1  'True
  14.    FontItalic      =   0   'False
  15.    FontName        =   "System"
  16.    FontSize        =   9.75
  17.    FontStrikethru  =   0   'False
  18.    FontUnderline   =   0   'False
  19.    Height          =   6045
  20.    Icon            =   0
  21.    Left            =   1125
  22.    LinkMode        =   1  'Source
  23.    LinkTopic       =   "Form1"
  24.    MaxButton       =   0   'False
  25.    MinButton       =   0   'False
  26.    ScaleHeight     =   5640
  27.    ScaleWidth      =   4920
  28.    Top             =   1725
  29.    Width           =   5040
  30.    Begin CommandButton BTN_OK 
  31.       Caption         =   "&OK"
  32.       Height          =   465
  33.       Left            =   1920
  34.       TabIndex        =   8
  35.       Top             =   5125
  36.       Width           =   1200
  37.    End
  38.    Begin Label RegToLabel 
  39.       Alignment       =   2  'Center
  40.       BackStyle       =   0  'Transparent
  41.       Caption         =   "This copy of Microsoft Windows is registered to:"
  42.       Height          =   240
  43.       Left            =   0
  44.       TabIndex        =   13
  45.       Top             =   3000
  46.       Width           =   4875
  47.    End
  48.    Begin Label UserNameLabel 
  49.       Alignment       =   2  'Center
  50.       BackStyle       =   0  'Transparent
  51.       Caption         =   "UserName"
  52.       Height          =   240
  53.       Left            =   0
  54.       TabIndex        =   12
  55.       Top             =   3175
  56.       Width           =   4875
  57.    End
  58.    Begin Label DisclaimerLabel 
  59.       Alignment       =   2  'Center
  60.       BackStyle       =   0  'Transparent
  61.       Caption         =   "RegNoticeText"
  62.       Height          =   1725
  63.       Left            =   15
  64.       TabIndex        =   11
  65.       Top             =   3495
  66.       Width           =   4875
  67.    End
  68.    Begin Label Lbl_InfoValue 
  69.       BackStyle       =   0  'Transparent
  70.       Caption         =   "SysInfoValues"
  71.       Height          =   1050
  72.       Left            =   2900
  73.       TabIndex        =   10
  74.       Top             =   2100
  75.       Width           =   1900
  76.    End
  77.    Begin Label Lbl_Info 
  78.       Alignment       =   1  'Right Justify
  79.       BackStyle       =   0  'Transparent
  80.       Caption         =   "SysInfo"
  81.       Height          =   1050
  82.       Left            =   100
  83.       TabIndex        =   9
  84.       Top             =   2100
  85.       Width           =   2600
  86.    End
  87.    Begin Label Label7 
  88.       Alignment       =   2  'Center
  89.       BackColor       =   &H00FFFFFF&
  90.       BackStyle       =   0  'Transparent
  91.       Caption         =   "CompuServe:  73122,1474"
  92.       Height          =   240
  93.       Left            =   0
  94.       TabIndex        =   7
  95.       Top             =   1750
  96.       Width           =   4875
  97.    End
  98.    Begin Label Label4 
  99.       Alignment       =   2  'Center
  100.       BackColor       =   &H00FFFFFF&
  101.       BackStyle       =   0  'Transparent
  102.       Caption         =   "Canton, Ohio  44709"
  103.       ForeColor       =   &H00000000&
  104.       Height          =   240
  105.       Left            =   0
  106.       TabIndex        =   4
  107.       Top             =   1290
  108.       Width           =   4875
  109.    End
  110.    Begin Label Label3 
  111.       Alignment       =   2  'Center
  112.       BackColor       =   &H00FFFFFF&
  113.       BackStyle       =   0  'Transparent
  114.       Caption         =   "1120 21st St. N.W."
  115.       ForeColor       =   &H00000000&
  116.       Height          =   240
  117.       Left            =   0
  118.       TabIndex        =   3
  119.       Top             =   1100
  120.       Width           =   4875
  121.    End
  122.    Begin Label Label2 
  123.       Alignment       =   2  'Center
  124.       BackColor       =   &H00FFFFFF&
  125.       BackStyle       =   0  'Transparent
  126.       Caption         =   "Mike Davis"
  127.       ForeColor       =   &H00000000&
  128.       Height          =   240
  129.       Left            =   0
  130.       TabIndex        =   2
  131.       Top             =   900
  132.       Width           =   4875
  133.    End
  134.    Begin Label Label1 
  135.       Alignment       =   2  'Center
  136.       BackColor       =   &H00FFFFFF&
  137.       BackStyle       =   0  'Transparent
  138.       Caption         =   "America Online:  VDG Mike  "
  139.       ForeColor       =   &H00000000&
  140.       Height          =   240
  141.       Left            =   0
  142.       TabIndex        =   1
  143.       Top             =   1550
  144.       Width           =   4875
  145.    End
  146.    Begin Label LAB_2 
  147.       Alignment       =   2  'Center
  148.       BackColor       =   &H00FFFFFF&
  149.       BackStyle       =   0  'Transparent
  150.       Caption         =   "Copyright 
  151.  1994 by Mike Davis"
  152.       ForeColor       =   &H00000000&
  153.       Height          =   240
  154.       Left            =   0
  155.       TabIndex        =   0
  156.       Top             =   590
  157.       Width           =   4875
  158.    End
  159.    Begin Label Label5 
  160.       Alignment       =   2  'Center
  161.       BackColor       =   &H00FFFFFF&
  162.       BackStyle       =   0  'Transparent
  163.       Caption         =   "October 1994"
  164.       ForeColor       =   &H00000000&
  165.       Height          =   240
  166.       Left            =   0
  167.       TabIndex        =   5
  168.       Top             =   360
  169.       Width           =   4875
  170.    End
  171.    Begin Label LAB_1 
  172.       Alignment       =   2  'Center
  173.       AutoSize        =   -1  'True
  174.       BackColor       =   &H00FFFFFF&
  175.       BackStyle       =   0  'Transparent
  176.       Caption         =   "Midi Player Demo"
  177.       FontBold        =   -1  'True
  178.       FontItalic      =   0   'False
  179.       FontName        =   "MS Sans Serif"
  180.       FontSize        =   13.5
  181.       FontStrikethru  =   0   'False
  182.       FontUnderline   =   0   'False
  183.       ForeColor       =   &H00000000&
  184.       Height          =   360
  185.       Left            =   1185
  186.       TabIndex        =   6
  187.       Top             =   0
  188.       Width           =   2505
  189.    End
  190. DefInt A-Z
  191. ' API functions used in getting user and company name
  192. Declare Function LoadLibrary% Lib "Kernel" (ByVal LibFileName$)
  193. Declare Sub FreeLibrary Lib "Kernel" (ByVal hInst%)
  194. Declare Function LoadString% Lib "User" (ByVal hInst%, ByVal idResource%, ByVal Buffer$, ByVal cBuffer%)
  195. ' GetVersion returns both Windows and DOS versions
  196. Declare Function GetVersion& Lib "Kernel" ()
  197. ' This function returns a Long that's filled with bit-flags providing
  198. ' information about Windows.
  199. Declare Function GetWinFlags& Lib "Kernel" ()
  200.  Const WF_PMODE = &H1
  201.  Const WF_STANDARD = &H10
  202.  Const WF_ENHANCED = &H20
  203.  Const WF_80x87 = &H400
  204. ' This function returns the amount of free memory
  205. Declare Function GetFreeSpace& Lib "Kernel" (ByVal wFlags%)
  206. 'This function returns the free system resources
  207. Declare Function GetFreeSystemResources% Lib "User" (ByVal fuSysResource%)
  208.  Const GFSR_SYSTEMRESOURCES = 0
  209.  Const GFSR_GDIRESOURCES = 1
  210.  Const GFSR_USERRESOURCES = 2
  211. Sub BTN_OK_Click ()
  212.     Unload AboutBox
  213. End Sub
  214. Function FixAmpersand$ (ByVal Buffer As String)
  215.   Dim N%
  216.   N = 1
  217.   Do Until N = 0
  218.     N = InStr(N, Buffer, "&")
  219.     If N > 0 Then
  220.       Buffer = Left$(Buffer, N) + Mid$(Buffer, N)
  221.       N = N + 2
  222.     End If
  223.   Loop
  224.   Do While Right$(Buffer, 1) = Chr$(0) 'Or Right$(Buffer, 1) = " "
  225.     Buffer = Left$(Buffer, Len(Buffer) - 1)
  226.   Loop
  227.   FixAmpersand = Buffer
  228. End Function
  229. Sub Form_Load ()
  230.     Dim WinFlags As Long
  231.     Dim Mode As String, CoProcessor As String
  232.     Move (Screen.Width - Width) \ 2, ((Screen.Height - Height) \ 2 - 200)
  233.     ' Get current Windows configuration
  234.     WinFlags = GetWinFlags()
  235.     If WinFlags And WF_ENHANCED Then
  236.         Mode = "386 Enhanced Mode"
  237.     Else
  238.         Mode = "Standard Mode"
  239.     End If
  240.     Lbl_Info.Caption = Mode + CRLF + "Free Memory:" + CRLF + "Math Co-processor:" + CRLF + "System Resources:"
  241.     If WinFlags And WF_80x87 Then
  242.         CoProcessor = "Present"
  243.     Else
  244.         CoProcessor = "None"
  245.     End If
  246.     I% = GetFreeSystemResources(2)
  247.     Lbl_InfoValue.Caption = CRLF + Format$(GetFreeSpace(0) \ 1024) + " KB" + CRLF + CoProcessor + CRLF + Str(I%) + "%"
  248.     'Resolution.Caption = "Resolution: " & Screen.Width \ Screen.TwipsPerPixelX & " x " & Screen.Height \ Screen.TwipsPerPixelY
  249.     DisclaimerText$ = " This software and the accompanying files are provided ""as is"" "
  250.     DisclaimerText$ = DisclaimerText$ + "and without warranties as to performance of the software and "
  251.     DisclaimerText$ = DisclaimerText$ + " the accompanying files or any other warranties whether expressed "
  252.     DisclaimerText$ = DisclaimerText$ + " or implied.  No warranty of fitness for a particular purpose "
  253.     DisclaimerText$ = DisclaimerText$ + "is offered." + CRLF + CRLF
  254.     DisclaimerText$ = DisclaimerText$ + "You may not sell this software or it's source code." + CRLF
  255.     DisclaimerText$ = DisclaimerText$ + "You may use this code in any way you find useful."
  256.     DisclaimerLabel.Caption = DisclaimerText$
  257.     ' Get access to USER's strings by getting a handle to USER
  258.     Dim hInstUser As Integer
  259.     hInstUser = LoadLibrary("USER")
  260.     FreeLibrary hInstUser
  261.     Dim Buffer As String, Success As Integer, N As Integer
  262.   ' Get the User name
  263.     Buffer = String$(31, 0)
  264.     If LoadString(hInstUser, 514, Buffer, 30) Then
  265.       UserNameLabel.Caption = Trim(FixAmpersand(Buffer))
  266.     End If
  267.   ' Get the Company name
  268.   '  Buffer = String$(31, 0)
  269.   '  If LoadString(hInstUser, 515, Buffer, 30) Then
  270.   '    'CompanyName$ = FixAmpersand(Buffer)
  271.   '    CompanyLabel.Caption = Trim(FixAmpersand(Buffer))
  272.   '  End If
  273. End Sub
  274.